package com.example.main

import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentActivity
import androidx.viewpager2.adapter.FragmentStateAdapter
import com.example.home.HomeFragment
import com.example.message.MessageFragment
import com.example.mine.MineFragment
import com.example.notice.NoticeFragment
import com.example.service.ServiceFragment

class MyPageAdapter (fragmentActivity: FragmentActivity):FragmentStateAdapter(fragmentActivity){
    private val fragmentList = listOf(
        HomeFragment(),
        ServiceFragment(),
        MessageFragment(),
        NoticeFragment(),
        MineFragment()
    )
    override fun getItemCount(): Int =fragmentList.size

    override fun createFragment(position: Int): Fragment=fragmentList[position]
}